.row.wrapper.border-bottom.white-bg.page-heading
  .col-lg-12
    h2 &#x4EFB;&#x52A1;&#x4E1A;&#x52A1;&#x65E5;&#x5FD7;
    |         
    ol.breadcrumb
      li
        a &#x65E5;&#x5FD7;
      |             
      li.active
        b &#x4EFB;&#x52A1;&#x4E1A;&#x52A1;&#x65E5;&#x5FD7;
.wrapper.wrapper-content.animated.fadeInRight
  .row
    .col-lg-12
      .ibox
        .ibox-title
          h3
            | &#x6309; 
            span.text-navy &#x4EFB;&#x52A1;ID
            |  &#x67E5;&#x8BE2;
        |                 
        .ibox-content
          form.form-horizontal(method='post', onsubmit='return false')
            .form-group
              label.col-sm-2.control-label &#x4EFB;&#x52A1;ID
              |                             
              .col-sm-3
                input.form-control(type='text', name='taskId', value='$!taskId', placeholder='请输入你提交的任务ID(TaskId)')
              |                             
              label.col-sm-1.control-label &#x8282;&#x70B9;&#x7EC4;
              |                             
              .col-sm-3
                select.form-control.selectpicker(name='taskTrackerNodeGroup')
                  option(value='') -- &#x4E0D;&#x9650; --
                  |                                     #foreach ($nodeGroup in $taskTrackerNodeGroups)
                  |                                         #if ($taskTrackerNodeGroup == $nodeGroup.name)
                  |                                             
                  option(value='$nodeGroup.name', selected='') $nodeGroup.name
                  |                                         #else
                  |                                             
                  option(value='$nodeGroup.name') $nodeGroup.name
                  |                                         #end
                  |                                     #end
            |                         
            .form-group.row
              label.col-sm-2.control-label &#x65F6;&#x95F4;
              |                             
              .col-sm-2
                input#startLogTime.form-control.datepicker(type='text', style='width:160px', name='startLogTime', date-format='yyyy-MM-dd HH:mm:ss', placeholder='yyyy-MM-dd HH:mm:ss', value='$startLogTime')
              |                             
              label.control-label(style='width: 20px;float: left;') &#x5230;
              |                             
              .col-sm-3
                input#endLogTime.form-control.datepicker(type='text', style='width:160px', name='endLogTime', date-format='yyyy-MM-dd HH:mm:ss', placeholder='yyyy-MM-dd HH:mm:ss', value='$endLogTime')
              |                             
              .col-sm-2
                .col-sm-2
                  button#searchBtn.btn.btn-primary(type='button')
                    | &#x641C;&#x7D22;
            |                         
            .hr-line-dashed
  |     
  .row
    .col-lg-12
      .ibox
        #ltstableContainer.ibox-content
script#ltstable(type='text/html').
  <table class="table table-stripped toggle-arrow-tiny footable" data-page-size="10">
  <thead>
  <tr>
  <th data-toggle="true">任务ID</th>
  <th>日志记录时间</th>
  <th data-hide="all">日志创建时间</th>
  <th>执行节点组</th>
  <th data-hide="phone,tablet">提交节点组</th>
  <th>日志类型</th>
  <th>执行结果</th>
  <th data-hide="all">日志级别</th>
  <th data-hide="all">重试次数</th>
  <th data-hide="all">优先级</th>
  <th data-hide="all">执行时间</th>
  <th>Cron表达式</th>
  <th data-hide="all">反馈客户端</th>
  <th data-hide="all">用户参数</th>
  <th data-hide="all">内容</th>
  </tr>
  </thead>
  <tbody>
  {{each rows as row index}}
  <tr>
  <td>{{row.taskId}}</td>
  <td>{{row.logTime | dateFormat:'yyyy-MM-dd HH:mm:ss'}}</td>
  <td>{{row.gmtCreated | dateFormat:'yyyy-MM-dd HH:mm:ss'}}</td>
  <td>{{row.taskTrackerNodeGroup}}</td>
  <td>{{row.submitNodeGroup}}</td>
  <td>{{row.logType | format:'logTypeLabel'}}</td>
  <td>{{row.success | format:'successLabel'}}</td>
  <td>{{row.level}}</td>
  <td>{{row.retryTimes}}</td>
  <td>{{row.priority}}</td>
  <td>{{row.triggerTime | dateFormat:'yyyy-MM-dd HH:mm:ss'}}</td>
  <td>{{row.cronExpression}}</td>
  <td>{{row.needFeedback | format:'needFeedbackLabel'}}</td>
  <td>{{row.extParams | format:'stringifyJSON'}}</td>
  <td>
  <pre>{{row.msg}}</pre>
  </td>
  </tr>
  {{/each}}
  {{if results == 0}}
  <tr>
  <td colspan="15">暂无数据</td>
  </tr>
  {{/if}}
  </tbody>
  <tfoot>
  <tr>
  <td colspan="8">
  <span>共{{results}}条记录，每页展示{{pageSize}}条</span>
  <ul class="pagination-sm pull-right"></ul>
  </td>
  </tr>
  </tfoot>
  </table>
style.
  pre {
  padding: 0px;
  background-color: transparent;
  border: 0;
  }
script.
  $(document).ready(function () {
  var LOG_TYPE = {
  RECEIVE: '接受任务',
  SENT: '派发任务',
  FINISHED: '完成任务',
  FIXED_DEAD: '修复死任务',
  BIZ: '业务日志',
  RESEND: '重新反馈任务'
  };
  LTS.colFormatter.logTypeLabel = function (v) {
  return v ? LOG_TYPE[v] : v;
  }
  LTS.colFormatter.successLabel = function (v) {
  return v ? "成功" : "失败";
  }
  var ltsTable = $("#ltstableContainer").ltsTable({
  url: 'api/job-logger/job-logger-get',
  templateId: 'ltstable'
  });
  $(document).on("click", "#searchBtn", function () {
  var taskId = $("input[name='taskId']").val();
  //            if (!taskId) {
  //                sweetAlert("请输入任务ID", "请输入你提交的任务ID(TaskId)", "error");
  //                return;
  //            }
  var taskTrackerNodeGroup = $("select[name='taskTrackerNodeGroup']").val();
  var startLogTime = $("input[name='startLogTime']").val();
  var endLogTime = $("input[name='endLogTime']").val();
  if (!startLogTime) {
  sweetAlert("请输入开始查询时间", "格式 yyyy-MM-dd HH:mm:ss", "error");
  return;
  }
  if (!LTS.ReExp.time.test(startLogTime)) {
  sweetAlert("开始查询时间格式不正确", "格式 yyyy-MM-dd HH:mm:ss", "error");
  return;
  }
  if (!endLogTime) {
  sweetAlert("请输入结束查询时间", "格式 yyyy-MM-dd HH:mm:ss", "error");
  return;
  }
  if (!LTS.ReExp.time.test(endLogTime)) {
  sweetAlert("结束查询时间格式不正确", "格式 yyyy-MM-dd HH:mm:ss", "error");
  return;
  }
  var params = {
  taskId: taskId,
  taskTrackerNodeGroup: taskTrackerNodeGroup,
  startLogTime: startLogTime, endLogTime: endLogTime
  };
  if (!taskId) {
  // 如果没有按ID查询，那么要对时间跨度长的做提醒(超过1小时的)
  if ((DateUtil.parse(endLogTime).getTime() - DateUtil.parse(startLogTime).getTime()) > 60 * 60 * 1000) {
  swal({
  title: "确认查询操作？",
  text: "您当前查询日志没有按照任务ID查询，时间跨度大于1小时，可能查询结果会比较大 !",
  type: "warning",
  showCancelButton: true,
  confirmButtonColor: "#DD6B55",
  cancelButtonText: "取消",
  confirmButtonText: "我要查询",
  closeOnConfirm: true
  }, function (isConfirm) {
  if (isConfirm) {
  ltsTable.post(params, 1);
  }
  });
  } else {
  ltsTable.post(params, 1);
  }
  } else {
  ltsTable.post(params, 1);
  }
  });
  var taskId = $("input[name='taskId']").val();
  if (taskId) {
  // 如果是按ID查询，要把时间设置长一点
  var startLongTime = DateUtil.formatYMDHMD(DateUtil.getDate(new Date(), -10));
  $("input[name='startLogTime']").val(startLongTime);
  $("#searchBtn").trigger("click");
  } else {
  ltsTable.renderEmpty();
  }
  });
